// Copyright (c) 2011 Shardul Deo
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: proto/rpc.proto

package com.googlecode.protobuf.socketrpc;

public final class SocketRpcProtos {
  private SocketRpcProtos() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public enum ErrorReason
      implements com.google.protobuf.ProtocolMessageEnum {
    BAD_REQUEST_DATA(0, 0),
    BAD_REQUEST_PROTO(1, 1),
    SERVICE_NOT_FOUND(2, 2),
    METHOD_NOT_FOUND(3, 3),
    RPC_ERROR(4, 4),
    RPC_FAILED(5, 5),
    INVALID_REQUEST_PROTO(6, 6),
    BAD_RESPONSE_PROTO(7, 7),
    UNKNOWN_HOST(8, 8),
    IO_ERROR(9, 9),
    ;

    public static final int BAD_REQUEST_DATA_VALUE = 0;
    public static final int BAD_REQUEST_PROTO_VALUE = 1;
    public static final int SERVICE_NOT_FOUND_VALUE = 2;
    public static final int METHOD_NOT_FOUND_VALUE = 3;
    public static final int RPC_ERROR_VALUE = 4;
    public static final int RPC_FAILED_VALUE = 5;
    public static final int INVALID_REQUEST_PROTO_VALUE = 6;
    public static final int BAD_RESPONSE_PROTO_VALUE = 7;
    public static final int UNKNOWN_HOST_VALUE = 8;
    public static final int IO_ERROR_VALUE = 9;


    public final int getNumber() { return value; }

    public static ErrorReason valueOf(int value) {
      switch (value) {
        case 0: return BAD_REQUEST_DATA;
        case 1: return BAD_REQUEST_PROTO;
        case 2: return SERVICE_NOT_FOUND;
        case 3: return METHOD_NOT_FOUND;
        case 4: return RPC_ERROR;
        case 5: return RPC_FAILED;
        case 6: return INVALID_REQUEST_PROTO;
        case 7: return BAD_RESPONSE_PROTO;
        case 8: return UNKNOWN_HOST;
        case 9: return IO_ERROR;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<ErrorReason>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static com.google.protobuf.Internal.EnumLiteMap<ErrorReason>
        internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<ErrorReason>() {
            public ErrorReason findValueByNumber(int number) {
              return ErrorReason.valueOf(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(index);
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.googlecode.protobuf.socketrpc.SocketRpcProtos.getDescriptor().getEnumTypes().get(0);
    }

    private static final ErrorReason[] VALUES = {
      BAD_REQUEST_DATA, BAD_REQUEST_PROTO, SERVICE_NOT_FOUND, METHOD_NOT_FOUND, RPC_ERROR, RPC_FAILED, INVALID_REQUEST_PROTO, BAD_RESPONSE_PROTO, UNKNOWN_HOST, IO_ERROR,
    };

    public static ErrorReason valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      return VALUES[desc.getIndex()];
    }

    private final int index;
    private final int value;

    private ErrorReason(int index, int value) {
      this.index = index;
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:protobuf.socketrpc.ErrorReason)
  }

  public interface RequestOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string service_name = 1;
    boolean hasServiceName();
    String getServiceName();

    // required string method_name = 2;
    boolean hasMethodName();
    String getMethodName();

    // required bytes request_proto = 3;
    boolean hasRequestProto();
    com.google.protobuf.ByteString getRequestProto();
  }
  public static final class Request extends
      com.google.protobuf.GeneratedMessage
      implements RequestOrBuilder {
    // Use Request.newBuilder() to construct.
    private Request(Builder builder) {
      super(builder);
    }
    private Request(boolean noInit) {}

    private static final Request defaultInstance;
    public static Request getDefaultInstance() {
      return defaultInstance;
    }

    public Request getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Request_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Request_fieldAccessorTable;
    }

    private int bitField0_;
    // required string service_name = 1;
    public static final int SERVICE_NAME_FIELD_NUMBER = 1;
    private Object serviceName_;
    public boolean hasServiceName() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    public String getServiceName() {
      Object ref = serviceName_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          serviceName_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getServiceNameBytes() {
      Object ref = serviceName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        serviceName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string method_name = 2;
    public static final int METHOD_NAME_FIELD_NUMBER = 2;
    private Object methodName_;
    public boolean hasMethodName() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    public String getMethodName() {
      Object ref = methodName_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          methodName_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getMethodNameBytes() {
      Object ref = methodName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        methodName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required bytes request_proto = 3;
    public static final int REQUEST_PROTO_FIELD_NUMBER = 3;
    private com.google.protobuf.ByteString requestProto_;
    public boolean hasRequestProto() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    public com.google.protobuf.ByteString getRequestProto() {
      return requestProto_;
    }

    private void initFields() {
      serviceName_ = "";
      methodName_ = "";
      requestProto_ = com.google.protobuf.ByteString.EMPTY;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasServiceName()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasMethodName()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasRequestProto()) {
        memoizedIsInitialized = 0;
        return false;
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getServiceNameBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getMethodNameBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, requestProto_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getServiceNameBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getMethodNameBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, requestProto_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    @java.lang.Override
    protected Object writeReplace() throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements com.googlecode.protobuf.socketrpc.SocketRpcProtos.RequestOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Request_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Request_fieldAccessorTable;
      }

      // Construct using com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        serviceName_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        methodName_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        requestProto_ = com.google.protobuf.ByteString.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request.getDescriptor();
      }

      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request getDefaultInstanceForType() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request.getDefaultInstance();
      }

      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request build() {
        com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      private com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return result;
      }

      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request buildPartial() {
        com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request result = new com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.serviceName_ = serviceName_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.methodName_ = methodName_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.requestProto_ = requestProto_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request) {
          return mergeFrom((com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request other) {
        if (other == com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request.getDefaultInstance()) return this;
        if (other.hasServiceName()) {
          setServiceName(other.getServiceName());
        }
        if (other.hasMethodName()) {
          setMethodName(other.getMethodName());
        }
        if (other.hasRequestProto()) {
          setRequestProto(other.getRequestProto());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasServiceName()) {

          return false;
        }
        if (!hasMethodName()) {

          return false;
        }
        if (!hasRequestProto()) {

          return false;
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              onChanged();
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                onChanged();
                return this;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              serviceName_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              methodName_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              requestProto_ = input.readBytes();
              break;
            }
          }
        }
      }

      private int bitField0_;

      // required string service_name = 1;
      private Object serviceName_ = "";
      public boolean hasServiceName() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      public String getServiceName() {
        Object ref = serviceName_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          serviceName_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setServiceName(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        serviceName_ = value;
        onChanged();
        return this;
      }
      public Builder clearServiceName() {
        bitField0_ = (bitField0_ & ~0x00000001);
        serviceName_ = getDefaultInstance().getServiceName();
        onChanged();
        return this;
      }
      void setServiceName(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000001;
        serviceName_ = value;
        onChanged();
      }

      // required string method_name = 2;
      private Object methodName_ = "";
      public boolean hasMethodName() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      public String getMethodName() {
        Object ref = methodName_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          methodName_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setMethodName(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        methodName_ = value;
        onChanged();
        return this;
      }
      public Builder clearMethodName() {
        bitField0_ = (bitField0_ & ~0x00000002);
        methodName_ = getDefaultInstance().getMethodName();
        onChanged();
        return this;
      }
      void setMethodName(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000002;
        methodName_ = value;
        onChanged();
      }

      // required bytes request_proto = 3;
      private com.google.protobuf.ByteString requestProto_ = com.google.protobuf.ByteString.EMPTY;
      public boolean hasRequestProto() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      public com.google.protobuf.ByteString getRequestProto() {
        return requestProto_;
      }
      public Builder setRequestProto(com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        requestProto_ = value;
        onChanged();
        return this;
      }
      public Builder clearRequestProto() {
        bitField0_ = (bitField0_ & ~0x00000004);
        requestProto_ = getDefaultInstance().getRequestProto();
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:protobuf.socketrpc.Request)
    }

    static {
      defaultInstance = new Request(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:protobuf.socketrpc.Request)
  }

  public interface ResponseOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional bytes response_proto = 1;
    boolean hasResponseProto();
    com.google.protobuf.ByteString getResponseProto();

    // optional string error = 2;
    boolean hasError();
    String getError();

    // optional bool callback = 3 [default = false];
    boolean hasCallback();
    boolean getCallback();

    // optional .protobuf.socketrpc.ErrorReason error_reason = 4;
    boolean hasErrorReason();
    com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason getErrorReason();
  }
  public static final class Response extends
      com.google.protobuf.GeneratedMessage
      implements ResponseOrBuilder {
    // Use Response.newBuilder() to construct.
    private Response(Builder builder) {
      super(builder);
    }
    private Response(boolean noInit) {}

    private static final Response defaultInstance;
    public static Response getDefaultInstance() {
      return defaultInstance;
    }

    public Response getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Response_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Response_fieldAccessorTable;
    }

    private int bitField0_;
    // optional bytes response_proto = 1;
    public static final int RESPONSE_PROTO_FIELD_NUMBER = 1;
    private com.google.protobuf.ByteString responseProto_;
    public boolean hasResponseProto() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    public com.google.protobuf.ByteString getResponseProto() {
      return responseProto_;
    }

    // optional string error = 2;
    public static final int ERROR_FIELD_NUMBER = 2;
    private Object error_;
    public boolean hasError() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    public String getError() {
      Object ref = error_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (com.google.protobuf.Internal.isValidUtf8(bs)) {
          error_ = s;
        }
        return s;
      }
    }
    private com.google.protobuf.ByteString getErrorBytes() {
      Object ref = error_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((String) ref);
        error_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional bool callback = 3 [default = false];
    public static final int CALLBACK_FIELD_NUMBER = 3;
    private boolean callback_;
    public boolean hasCallback() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    public boolean getCallback() {
      return callback_;
    }

    // optional .protobuf.socketrpc.ErrorReason error_reason = 4;
    public static final int ERROR_REASON_FIELD_NUMBER = 4;
    private com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason errorReason_;
    public boolean hasErrorReason() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    public com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason getErrorReason() {
      return errorReason_;
    }

    private void initFields() {
      responseProto_ = com.google.protobuf.ByteString.EMPTY;
      error_ = "";
      callback_ = false;
      errorReason_ = com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason.BAD_REQUEST_DATA;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, responseProto_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getErrorBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBool(3, callback_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeEnum(4, errorReason_.getNumber());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, responseProto_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getErrorBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(3, callback_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(4, errorReason_.getNumber());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    @java.lang.Override
    protected Object writeReplace() throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry)
               .buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      Builder builder = newBuilder();
      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
        return builder.buildParsed();
      } else {
        return null;
      }
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }
    public static com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry)
               .buildParsed();
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements com.googlecode.protobuf.socketrpc.SocketRpcProtos.ResponseOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Response_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.internal_static_protobuf_socketrpc_Response_fieldAccessorTable;
      }

      // Construct using com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        responseProto_ = com.google.protobuf.ByteString.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        error_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        callback_ = false;
        bitField0_ = (bitField0_ & ~0x00000004);
        errorReason_ = com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason.BAD_REQUEST_DATA;
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response.getDescriptor();
      }

      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response getDefaultInstanceForType() {
        return com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response.getDefaultInstance();
      }

      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response build() {
        com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      private com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response buildParsed()
          throws com.google.protobuf.InvalidProtocolBufferException {
        com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(
            result).asInvalidProtocolBufferException();
        }
        return result;
      }

      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response buildPartial() {
        com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response result = new com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.responseProto_ = responseProto_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.error_ = error_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.callback_ = callback_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.errorReason_ = errorReason_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response) {
          return mergeFrom((com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response other) {
        if (other == com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response.getDefaultInstance()) return this;
        if (other.hasResponseProto()) {
          setResponseProto(other.getResponseProto());
        }
        if (other.hasError()) {
          setError(other.getError());
        }
        if (other.hasCallback()) {
          setCallback(other.getCallback());
        }
        if (other.hasErrorReason()) {
          setErrorReason(other.getErrorReason());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder(
            this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              onChanged();
              return this;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                this.setUnknownFields(unknownFields.build());
                onChanged();
                return this;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              responseProto_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              error_ = input.readBytes();
              break;
            }
            case 24: {
              bitField0_ |= 0x00000004;
              callback_ = input.readBool();
              break;
            }
            case 32: {
              int rawValue = input.readEnum();
              com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason value = com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(4, rawValue);
              } else {
                bitField0_ |= 0x00000008;
                errorReason_ = value;
              }
              break;
            }
          }
        }
      }

      private int bitField0_;

      // optional bytes response_proto = 1;
      private com.google.protobuf.ByteString responseProto_ = com.google.protobuf.ByteString.EMPTY;
      public boolean hasResponseProto() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      public com.google.protobuf.ByteString getResponseProto() {
        return responseProto_;
      }
      public Builder setResponseProto(com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        responseProto_ = value;
        onChanged();
        return this;
      }
      public Builder clearResponseProto() {
        bitField0_ = (bitField0_ & ~0x00000001);
        responseProto_ = getDefaultInstance().getResponseProto();
        onChanged();
        return this;
      }

      // optional string error = 2;
      private Object error_ = "";
      public boolean hasError() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      public String getError() {
        Object ref = error_;
        if (!(ref instanceof String)) {
          String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
          error_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      public Builder setError(String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        error_ = value;
        onChanged();
        return this;
      }
      public Builder clearError() {
        bitField0_ = (bitField0_ & ~0x00000002);
        error_ = getDefaultInstance().getError();
        onChanged();
        return this;
      }
      void setError(com.google.protobuf.ByteString value) {
        bitField0_ |= 0x00000002;
        error_ = value;
        onChanged();
      }

      // optional bool callback = 3 [default = false];
      private boolean callback_ ;
      public boolean hasCallback() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      public boolean getCallback() {
        return callback_;
      }
      public Builder setCallback(boolean value) {
        bitField0_ |= 0x00000004;
        callback_ = value;
        onChanged();
        return this;
      }
      public Builder clearCallback() {
        bitField0_ = (bitField0_ & ~0x00000004);
        callback_ = false;
        onChanged();
        return this;
      }

      // optional .protobuf.socketrpc.ErrorReason error_reason = 4;
      private com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason errorReason_ = com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason.BAD_REQUEST_DATA;
      public boolean hasErrorReason() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      public com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason getErrorReason() {
        return errorReason_;
      }
      public Builder setErrorReason(com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000008;
        errorReason_ = value;
        onChanged();
        return this;
      }
      public Builder clearErrorReason() {
        bitField0_ = (bitField0_ & ~0x00000008);
        errorReason_ = com.googlecode.protobuf.socketrpc.SocketRpcProtos.ErrorReason.BAD_REQUEST_DATA;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:protobuf.socketrpc.Response)
    }

    static {
      defaultInstance = new Response(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:protobuf.socketrpc.Response)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_protobuf_socketrpc_Request_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_protobuf_socketrpc_Request_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_protobuf_socketrpc_Response_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_protobuf_socketrpc_Response_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\017proto/rpc.proto\022\022protobuf.socketrpc\"K\n" +
      "\007Request\022\024\n\014service_name\030\001 \002(\t\022\023\n\013method" +
      "_name\030\002 \002(\t\022\025\n\rrequest_proto\030\003 \002(\014\"\201\001\n\010R" +
      "esponse\022\026\n\016response_proto\030\001 \001(\014\022\r\n\005error" +
      "\030\002 \001(\t\022\027\n\010callback\030\003 \001(\010:\005false\0225\n\014error" +
      "_reason\030\004 \001(\0162\037.protobuf.socketrpc.Error" +
      "Reason*\331\001\n\013ErrorReason\022\024\n\020BAD_REQUEST_DA" +
      "TA\020\000\022\025\n\021BAD_REQUEST_PROTO\020\001\022\025\n\021SERVICE_N" +
      "OT_FOUND\020\002\022\024\n\020METHOD_NOT_FOUND\020\003\022\r\n\tRPC_" +
      "ERROR\020\004\022\016\n\nRPC_FAILED\020\005\022\031\n\025INVALID_REQUE",
      "ST_PROTO\020\006\022\026\n\022BAD_RESPONSE_PROTO\020\007\022\020\n\014UN" +
      "KNOWN_HOST\020\010\022\014\n\010IO_ERROR\020\tB4\n!com.google" +
      "code.protobuf.socketrpcB\017SocketRpcProtos"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_protobuf_socketrpc_Request_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_protobuf_socketrpc_Request_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_protobuf_socketrpc_Request_descriptor,
              new java.lang.String[] { "ServiceName", "MethodName", "RequestProto", },
              com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request.class,
              com.googlecode.protobuf.socketrpc.SocketRpcProtos.Request.Builder.class);
          internal_static_protobuf_socketrpc_Response_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_protobuf_socketrpc_Response_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_protobuf_socketrpc_Response_descriptor,
              new java.lang.String[] { "ResponseProto", "Error", "Callback", "ErrorReason", },
              com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response.class,
              com.googlecode.protobuf.socketrpc.SocketRpcProtos.Response.Builder.class);
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
  }

  // @@protoc_insertion_point(outer_class_scope)
}
